// pages/mine/lawyer/lawyer.js
const app = getApp()
const host = app.globalData.host
Page({

  /**
   * 页面的初始数据
   */
  data: {
    lawyerInfo:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    var that = this;
    var token = wx.getStorageSync('token')
    wx.request({
      url: host + '/users/lawyer',
      method: 'GET',
      header: {
        'content-type': 'application/json'
      },
      data: {
        token: token
      },
      success(res) {
        console.log(res.data);
        wx.hideLoading();
      
        if (res.data.code == 0) {
          that.setData({
            lawyerInfo:res.data.data
          })
        } else {
          app.globalData.isShow(res.data.msg)
        }
      },
      fail(res) {
        app.globalData.isShow(res.data.msg)
      }
    })
  }, 
})